Rendered, pixel-based image files include a file header, a color palette, and an image data array. Such pixel-based images may be relatively large, and thus require a substantial portion of space in a memory medium. An exemplary image data file format could be constructed as:Image=[HEADER][PALETTE][IMAGE DATA ARRAY]
The file header of the pixel-based image includes various information pertaining to the image, such as bitmap width in pixels (the number of pixels in a row of pixels), bitmap height in pixels (the number of pixels in a column of pixels), and number of bits used to define the color of a pixel. For example, if eight (8) bits are used to specify the color of a pixel, then there are a possible 256 different colors that may be used to define pixel color. Any suitable number of bits may be used to define the number of color choices for a pixel (for example, if twelve bits are used, up to 4096 colors are available to define the color for a pixel).
A color palette is a pre-defined, ordered array of elements that define a color value. Each color value includes color information to define the different colors that may be used to color a pixel. For example, the color information specifies a mixture of red, green, and blue colors, along with an intensity value and/or color depth value. The color palette location information defines the location of each array element of the color palette. Accordingly, individual colors of the color palette are indexed by their location in the color palette, and thus are identified by their unique color palette location value.
The image data array is a pre-defined, ordered array of elements that define the image on a pixel-by-pixel basis. For any particular image, the location of a pixel can be identified by its relative location in the image data array since there are n×m pixels in the image data array (where n is the number of pixels in a row of pixels and m is the number of pixels in a column of pixels). Thus, the relative location of the pixel data in the image data array defines the location of the pixel in the image.
The information in any particular array element of the image data array is one of the color palette location information values. Thus, each array element in the image data array points to a particular array element in the color palette (which has the color information for a particular color).
When the image is displayed and/or printed, each of the individual pixels of the image are displayed and/or printed. To print and/or display an individual pixel, the location of the pixel in the image is first determined based upon its relative location in the image data array. For each pixel, the array element of the image data array is retrieved for mapping to the color palette. Thus, the color palette location information retrieved for that pixel maps to the color for that particular pixel. Accordingly, the color information for that pixel is retrieved. That is, since the array element of the image data array specifies the color palette location value of a color in the color palette, the color information for that pixel is retrieved from the color information stored in the color palette for that particular pixel.
Since the same color may be used for many hundreds of pixels in an image, or even thousands of pixels in an image, the size of the rendered image is considerably reduced when the color of each individual pixel is defined by the color palette location value of the color palette. However, an image that uses a large number of pixels, such as a high resolution image and/or a large image, requires a relatively large portion of the memory medium during processing. Often, the image is stored in a writable and/or volatile memory, such as a disk drive, a flash memory, or the like.
Often, a plurality of similar images, or similar-sized images, are concurrently stored in the memory. Thus, a large portion of the memory may be required for image data management. Accordingly, there is a need in the industry to compress image data so as to reduce memory requirements.